package com.gitee.cashzhang27.test.boot.docker;

import com.gitee.cashzhang27.test.boot.docker.mapper.TestMapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Cash Zhang
 * @version v1.0
 * @since 2019/12/14 12:01
 */
@RestController
@SpringBootApplication
@MapperScan("com.gitee.cashzhang27.test.boot.docker.mapper")
public class BootDockerApplication {

  @Autowired private TestMapper testMapper;

  @Value("${spring.profiles.active}")
  private String active;

  public static void main(String[] args) {
    SpringApplication.run(BootDockerApplication.class);
  }

  @GetMapping("get")
  public void get() {
    System.out.println(this.testMapper.get());
  }

  @GetMapping("active")
  public String active() {
    return this.active;
  }
}
